/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package polybook.view;

import java.awt.Dimension;
import java.awt.event.KeyEvent;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import javax.swing.DefaultListModel;
import javax.swing.JOptionPane;
import polybook.MainController;
import polybook.model.Person;

/**
 *
 * @author epulapp
 */
public class DataPersonView extends NamedJPanel {
    
    protected static final String title = "Information Personne";
    private final static SimpleDateFormat dateNaissFormater = new SimpleDateFormat("dd/MM/yyyy");
    protected Person currentPerson = new Person();

    /**
     * Creates new form DataPersonView
     */
    public DataPersonView(Person person) {
        initComponents();
        
        this.currentPerson = person;
        this.datasPseudo.setText(person.getPseudo());
        this.datasPrenom.setText(person.getPrenom());
        this.datasNom.setText(person.getNom());
        this.datasFriends.setText(Integer.toString(person.getFriendList().size()));
        this.datasDateNaiss.setText(dateNaissFormater.format(person.getDateNaiss()));
        
        // Creation du model et insertion des donnees
        DefaultListModel listModel = new DefaultListModel();
        for(String hobbie : person.getHobbies().getContainer()) {
            listModel.addElement(hobbie);
        }
        this.datasHobbies.setModel(listModel);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonListFriends = new javax.swing.JButton();
        inputPseudoBFS = new javax.swing.JTextField();
        buttonSearchBFS = new javax.swing.JButton();
        labelPseudo = new javax.swing.JLabel();
        labelPrenom = new javax.swing.JLabel();
        labelNom = new javax.swing.JLabel();
        labelDateNaiss = new javax.swing.JLabel();
        labelHobbie = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        datasHobbies = new javax.swing.JList();
        jSeparator1 = new javax.swing.JSeparator();
        datasPseudo = new javax.swing.JLabel();
        datasPrenom = new javax.swing.JLabel();
        datasNom = new javax.swing.JLabel();
        datasDateNaiss = new javax.swing.JLabel();
        inputPseudoDFS = new javax.swing.JTextField();
        buttonSearchDFS = new javax.swing.JButton();
        buttonReturn = new javax.swing.JButton();
        labelFriends = new javax.swing.JLabel();
        datasFriends = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        inputHobbiesBFS = new javax.swing.JTextField();
        buttonSearchHobbiesBFS = new javax.swing.JButton();
        inputHobbiesDFS = new javax.swing.JTextField();
        buttonSearchHobbiesDFS = new javax.swing.JButton();

        setBorder(javax.swing.BorderFactory.createTitledBorder(getTitle()));
        setPreferredSize(new java.awt.Dimension(250, 530));

        buttonListFriends.setText("Afficher les amis");
        buttonListFriends.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonListFriendsActionPerformed(evt);
            }
        });

        buttonSearchBFS.setText("Recherche BFS");
        buttonSearchBFS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSearchBFSActionPerformed(evt);
            }
        });

        labelPseudo.setText("Pseudo :");

        labelPrenom.setText("Prénom :");

        labelNom.setText("Nom :");

        labelDateNaiss.setText("Date de naissance :");

        labelHobbie.setText("Hobbies :");

        datasHobbies.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane1.setViewportView(datasHobbies);

        datasPseudo.setText("jLabel1");

        datasPrenom.setText("jLabel1");

        datasNom.setText("jLabel1");

        datasDateNaiss.setText("jLabel1");

        buttonSearchDFS.setText("Recherche DFS");
        buttonSearchDFS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSearchDFSActionPerformed(evt);
            }
        });

        buttonReturn.setText("Retour");
        buttonReturn.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                buttonReturnMouseClicked(evt);
            }
        });

        labelFriends.setText("Nombre d'amis : ");

        datasFriends.setText("jLabel2");

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel1.setText("Recherche par pseudo");

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel2.setText("Recherche par centre d'interet");

        inputHobbiesBFS.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                inputHobbiesBFSKeyTyped(evt);
            }
        });

        buttonSearchHobbiesBFS.setText("Recherche BFS");
        buttonSearchHobbiesBFS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSearchHobbiesBFSActionPerformed(evt);
            }
        });

        inputHobbiesDFS.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                inputHobbiesDFSKeyTyped(evt);
            }
        });

        buttonSearchHobbiesDFS.setText("Recherche DFS");
        buttonSearchHobbiesDFS.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                buttonSearchHobbiesDFSActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(labelNom, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(labelPrenom, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 57, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(datasPrenom, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(datasNom, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(buttonListFriends, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jSeparator1)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(inputPseudoDFS, javax.swing.GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE)
                                    .addComponent(inputPseudoBFS))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(buttonSearchBFS, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(buttonSearchDFS, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                            .addComponent(buttonReturn, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(labelPseudo, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(datasPseudo, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(labelDateNaiss, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)
                                    .addComponent(labelFriends, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(datasDateNaiss, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE)
                                    .addComponent(datasFriends, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(labelHobbie)
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(inputHobbiesBFS, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(buttonSearchHobbiesBFS, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(inputHobbiesDFS, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(buttonSearchHobbiesDFS, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                        .addContainerGap())))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelPseudo, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(datasPseudo))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelPrenom)
                    .addComponent(datasPrenom))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelNom)
                    .addComponent(datasNom))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelFriends)
                    .addComponent(datasFriends))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelDateNaiss)
                    .addComponent(datasDateNaiss))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(labelHobbie)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel1)
                .addGap(7, 7, 7)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(inputPseudoBFS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(buttonSearchBFS))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(inputPseudoDFS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(buttonSearchDFS))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(inputHobbiesBFS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(buttonSearchHobbiesBFS))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(inputHobbiesDFS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(buttonSearchHobbiesDFS))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(buttonListFriends)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(buttonReturn)
                .addContainerGap(13, Short.MAX_VALUE))
        );

        buttonListFriends.getAccessibleContext().setAccessibleName("buttonDisplayFriends");
        inputPseudoBFS.getAccessibleContext().setAccessibleName("textFieldSearchBFS");
        buttonSearchBFS.getAccessibleContext().setAccessibleName("buttonSearchBFS");
        labelPseudo.getAccessibleContext().setAccessibleName("pseudoDisp");
        labelPrenom.getAccessibleContext().setAccessibleName("prenomDisp");
        labelNom.getAccessibleContext().setAccessibleName("nomDisp");
        labelDateNaiss.getAccessibleContext().setAccessibleName("birthdayDisp");
        inputPseudoDFS.getAccessibleContext().setAccessibleName("textSearchDFS");
        buttonSearchDFS.getAccessibleContext().setAccessibleName("buttonSearchDFS");
        buttonReturn.getAccessibleContext().setAccessibleName("buttonRetour");
    }// </editor-fold>//GEN-END:initComponents

    private void buttonSearchBFSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSearchBFSActionPerformed
        MainController controller = MainController.getInstance();
        Person personSearched = this.currentPerson.searchByPseudo_BFS(this.inputPseudoBFS.getText());
        if(personSearched == null) {
            JOptionPane.showMessageDialog(controller, "Aucune personne trouvé avec le pseudo " + this.inputPseudoBFS.getText(), "Resultat de votre recherche", JOptionPane.ERROR_MESSAGE);
        } else {
            String resultMessage = personSearched.getPrenom() + " " + personSearched.getNom() + " possede le pseudo cherché : " + personSearched.getPseudo();
            JOptionPane.showMessageDialog(controller, resultMessage, "Resultat de votre recherche", JOptionPane.INFORMATION_MESSAGE);
        }
    }//GEN-LAST:event_buttonSearchBFSActionPerformed

    private void buttonReturnMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_buttonReturnMouseClicked
        // TODO add your handling code here:
        
        //On récupère le controller.
        MainController controller = MainController.getInstance();
        //On recupère le tableau de personnes à afficher dans la JTable.
        ArrayList<Person> personList = 
                controller.getCurrentNetwork().getContainer();
        
        //Onaffiche ces personnes.
        PersonJTableModel currentDatasModel = new PersonJTableModel(personList);
        controller.getCurrentTable().setModel(currentDatasModel);
        currentDatasModel.fireTableDataChanged();
        
        
        MenuView menuView = new MenuView();
        //On met la dimension à Zero sinon cette instance ne disparait pas.
        //Le JLabel n'est plus la mais son image si.
        Dimension d = new Dimension();
        d.setSize(0, 0);
        //On applique la dimension.
        this.setSize(d);
        //On rappel la vue du menu par dessus.
        menuView.includeIn(controller.getBaseView().getDatasPanel());
        
    }//GEN-LAST:event_buttonReturnMouseClicked

    private void buttonListFriendsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonListFriendsActionPerformed
        
        MainController controller = MainController.getInstance();
        
        //Refresh de la JTable
        //Récupération de la liste d'amis de la personne en cours
        ArrayList<Person> personList = this.currentPerson.getFriendList();
        PersonJTableModel currentDatasModel = new PersonJTableModel(personList);
        controller.getCurrentTable().setModel(currentDatasModel);
        System.out.println(this.currentPerson.toString());
        
    }//GEN-LAST:event_buttonListFriendsActionPerformed

    private void buttonSearchHobbiesBFSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSearchHobbiesBFSActionPerformed
        Integer sameHobbies = Integer.parseInt(this.inputHobbiesBFS.getText());
        ArrayList<Person> resultsSearch = this.currentPerson.searchByHobbies_BFS(sameHobbies);
        
        MainController controller = MainController.getInstance();
        PersonJTableModel currentDatasModel = new PersonJTableModel(resultsSearch);
        controller.getCurrentTable().setModel(currentDatasModel);
    }//GEN-LAST:event_buttonSearchHobbiesBFSActionPerformed

    private void buttonSearchHobbiesDFSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSearchHobbiesDFSActionPerformed
        Integer sameHobbies = Integer.parseInt(this.inputHobbiesDFS.getText());
        ArrayList<Person> resultsSearch = this.currentPerson.searchByHobbies_DFS(sameHobbies);
        
        MainController controller = MainController.getInstance();
        PersonJTableModel currentDatasModel = new PersonJTableModel(resultsSearch);
        controller.getCurrentTable().setModel(currentDatasModel);
    }//GEN-LAST:event_buttonSearchHobbiesDFSActionPerformed

    private void buttonSearchDFSActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonSearchDFSActionPerformed
        MainController controller = MainController.getInstance();
        Person personSearched = this.currentPerson.searchByPseudo_DFS(this.inputPseudoDFS.getText());
        if(personSearched == null) {
            JOptionPane.showMessageDialog(controller, "Aucune personne trouvé avec le pseudo " + this.inputPseudoDFS.getText(), "Resultat de votre recherche", JOptionPane.ERROR_MESSAGE);
        } else {
            String resultMessage = personSearched.getPrenom() + " " + personSearched.getNom() + " possede le pseudo cherché : " + personSearched.getPseudo();
            JOptionPane.showMessageDialog(controller, resultMessage, "Resultat de votre recherche", JOptionPane.INFORMATION_MESSAGE);
        }
    }//GEN-LAST:event_buttonSearchDFSActionPerformed

    private void inputHobbiesBFSKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_inputHobbiesBFSKeyTyped
        checkIntValue(evt);
    }//GEN-LAST:event_inputHobbiesBFSKeyTyped

    private void inputHobbiesDFSKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_inputHobbiesDFSKeyTyped
        checkIntValue(evt);
    }//GEN-LAST:event_inputHobbiesDFSKeyTyped

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton buttonListFriends;
    private javax.swing.JButton buttonReturn;
    private javax.swing.JButton buttonSearchBFS;
    private javax.swing.JButton buttonSearchDFS;
    private javax.swing.JButton buttonSearchHobbiesBFS;
    private javax.swing.JButton buttonSearchHobbiesDFS;
    private javax.swing.JLabel datasDateNaiss;
    private javax.swing.JLabel datasFriends;
    private javax.swing.JList datasHobbies;
    private javax.swing.JLabel datasNom;
    private javax.swing.JLabel datasPrenom;
    private javax.swing.JLabel datasPseudo;
    private javax.swing.JTextField inputHobbiesBFS;
    private javax.swing.JTextField inputHobbiesDFS;
    private javax.swing.JTextField inputPseudoBFS;
    private javax.swing.JTextField inputPseudoDFS;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JLabel labelDateNaiss;
    private javax.swing.JLabel labelFriends;
    private javax.swing.JLabel labelHobbie;
    private javax.swing.JLabel labelNom;
    private javax.swing.JLabel labelPrenom;
    private javax.swing.JLabel labelPseudo;
    // End of variables declaration//GEN-END:variables

    @Override
    public String getTitle() {
        return title;
    }
    
    private void checkIntValue(KeyEvent evt) {
        char caractereSaisi = evt.getKeyChar();
        String caractereSaisiString = ""+caractereSaisi;
        try {
            Integer nbSaisi = Integer.parseInt(caractereSaisiString);
        }
        catch (NumberFormatException ex) {
            evt.consume();
        }
    }
}
